covid_on_suicideのWeighted regresion版
分析用データの読み込みおよび整理はcovid_on_sucide_dataset.Rmdを参照。
source("functions.R")df_analysis <- readr::read_csv("output/df_analysis.csv")## Rows: 1551 Columns: 273
## ─ Column specification ────────────────────────────
## Delimiter: ","
## chr (4): prefec_kanji, prefecture, prefec, prefec_kanji2
## dbl (268): id, month, year, suicide_total, suicide_male, suicide_female, su...
## date (1): date
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_OLS_notrend")
# Event study graph
graph_total_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "total_OLS_notrend")
graph_total_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_notrend")
# Event study graph
graph_total_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "total_WLS_notrend")
graph_total_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_OLS_trend")
# Event study graph
graph_total_OLS_trend <- event_study_graph(data = df_estimates ,
graph_title = "total_OLS_trend")
graph_total_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_trend")
# Event study graph
graph_total_WLS_trend <- event_study_graph(data = df_estimates ,
graph_title = "total_WLS_trend")
ggplotly(graph_total_WLS_trend)estimates_total_WLS_trend <- df_estimates #for robustness check
results_total_WLS_trend <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_trend")
# Event study graph
graph_total_WLS_trend_onlypost <- event_study_graph(data = df_estimates ,
graph_title = "total_WLS_trend")
ggplotly(graph_total_WLS_trend_onlypost)estimates_total_WLS_trend_onlypost <- df_estimates #for robustness check
results_total_WLS_trend_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_OLS_notrend")
# Event study graph
graph_total_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "total_OLS_notrend")
graph_total_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_notrend")
# Event study graph
graph_total_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "total_WLS_notrend")
graph_total_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_OLS_trend")
# Event study graph
graph_total_OLS_trend_covar <- event_study_graph(data = df_estimates ,
graph_title = "total_OLS_trend")
graph_total_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_total_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_trend")
# Event study graph
graph_total_WLS_trend_covar <- event_study_graph(data = df_estimates ,
graph_title = "total_WLS_trend")
ggplotly(graph_total_WLS_trend_covar)estimates_total_WLS_trend_covar <- df_estimates #for robustness check
results_total_WLS_trend_covar <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "total_WLS_trend")
# Event study graph
graph_total_WLS_trend_covar_onlypost <- event_study_graph(data = df_estimates,
graph_title = "total_WLS_trend")
ggplotly(graph_total_WLS_trend_covar_onlypost)estimates_total_WLS_trend_covar_onlypost <- df_estimates #for robustness check
results_total_WLS_trend_covar_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_OLS_notrend")
# Event study graph
graph_yoy_total_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_OLS_notrend")
graph_yoy_total_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_WLS_notrend")
# Event study graph
graph_yoy_total_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_WLS_notrend")
graph_yoy_total_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_OLS_trend")
# Event study graph
graph_yoy_total_OLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_OLS_trend")
graph_yoy_total_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_WLS_trend")
# Event study graph
graph_yoy_total_WLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_WLS_trend")
ggplotly(graph_yoy_total_WLS_trend)estimates_yoy_total_WLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_OLS_notrend")
# Event study graph
graph_yoy_total_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_OLS_notrend")
graph_yoy_total_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_WLS_notrend")
# Event study graph
graph_yoy_total_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_WLS_notrend")
graph_yoy_total_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_OLS_trend")
# Event study graph
graph_yoy_total_OLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_OLS_trend")
graph_yoy_total_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_total_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate,
treat_var = df_analysis$job_seeker_total_shock)
texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)## 2 coefficients not defined because the design matrix is rank deficient
##
## ====================================================================
## Model 1
## --------------------------------------------------------------------
## treat_var:date_2018_01
##
## treat_var:date_2018_02 0.577
## (1.002)
## treat_var:date_2018_03 0.225
## (0.886)
## treat_var:date_2018_04 -0.049
## (0.796)
## treat_var:date_2018_05 0.672
## (0.834)
## treat_var:date_2018_06 0.154
## (0.742)
## treat_var:date_2018_07 -1.509
## (0.941)
## treat_var:date_2018_08 -0.027
## (0.732)
## treat_var:date_2018_09 -0.584
## (1.122)
## treat_var:date_2018_10 -0.613
## (0.799)
## treat_var:date_2018_11 -1.006
## (0.597)
## treat_var:date_2018_12 -0.959
## (1.062)
## treat_var:date_2019_01 -2.361 *
## (1.124)
## treat_var:date_2019_02 -1.091
## (0.665)
## treat_var:date_2019_03 -1.582
## (1.244)
## treat_var:date_2019_04 -1.927
## (1.224)
## treat_var:date_2019_05 -2.525 **
## (0.880)
## treat_var:date_2019_06 -1.142
## (0.709)
## treat_var:date_2019_07 -0.855
## (0.960)
## treat_var:date_2019_08 -3.528 ***
## (0.966)
## treat_var:date_2019_09 -1.492
## (0.997)
## treat_var:date_2019_10 -1.585
## (0.928)
## treat_var:date_2019_11 -1.750
## (0.904)
## treat_var:date_2019_12 -1.618
## (1.034)
## treat_var:date_2020_02 -1.957
## (1.235)
## treat_var:date_2020_03 -3.172 **
## (1.157)
## treat_var:date_2020_04 -1.846
## (1.043)
## treat_var:date_2020_05 -2.815
## (1.743)
## treat_var:date_2020_06 -2.806 *
## (1.365)
## treat_var:date_2020_07 -2.154
## (1.081)
## treat_var:date_2020_08 -1.224
## (1.967)
## treat_var:date_2020_09 -3.481 *
## (1.429)
## date_2020_02:google_mobility_index_2020may 0.041
## (0.030)
## date_2020_03:google_mobility_index_2020may -0.015
## (0.049)
## date_2020_04:google_mobility_index_2020may 0.003
## (0.039)
## date_2020_05:google_mobility_index_2020may -0.014
## (0.047)
## date_2020_06:google_mobility_index_2020may 0.069
## (0.036)
## date_2020_07:google_mobility_index_2020may -0.040
## (0.043)
## date_2020_08:google_mobility_index_2020may 0.093
## (0.064)
## date_2020_09:google_mobility_index_2020may 0.039
## (0.043)
## date_2020_02:infection_rate_cumulative2020jun 1.993
## (1.629)
## date_2020_03:infection_rate_cumulative2020jun 1.780
## (2.258)
## date_2020_04:infection_rate_cumulative2020jun 0.021
## (1.638)
## date_2020_05:infection_rate_cumulative2020jun 0.066
## (2.167)
## date_2020_06:infection_rate_cumulative2020jun 3.755
## (2.000)
## date_2020_07:infection_rate_cumulative2020jun -0.960
## (1.932)
## date_2020_08:infection_rate_cumulative2020jun 5.283
## (2.946)
## date_2020_09:infection_rate_cumulative2020jun 1.740
## (2.264)
## date_2020_02:death_rate_cumulative2020jun -36.720
## (23.732)
## date_2020_03:death_rate_cumulative2020jun -16.007
## (23.488)
## date_2020_04:death_rate_cumulative2020jun 7.979
## (16.543)
## date_2020_05:death_rate_cumulative2020jun -24.766
## (24.083)
## date_2020_06:death_rate_cumulative2020jun -1.906
## (23.724)
## date_2020_07:death_rate_cumulative2020jun -13.057
## (20.040)
## date_2020_08:death_rate_cumulative2020jun -68.002
## (34.999)
## date_2020_09:death_rate_cumulative2020jun -24.005
## (21.359)
## date_2020_02:Population_per_1_km_2_of_inhabitable_area 0.000
## (0.000)
## date_2020_03:Population_per_1_km_2_of_inhabitable_area -0.000
## (0.000)
## date_2020_04:Population_per_1_km_2_of_inhabitable_area 0.000
## (0.000)
## date_2020_05:Population_per_1_km_2_of_inhabitable_area -0.000
## (0.000)
## date_2020_06:Population_per_1_km_2_of_inhabitable_area -0.000
## (0.000)
## date_2020_07:Population_per_1_km_2_of_inhabitable_area -0.000
## (0.000)
## date_2020_08:Population_per_1_km_2_of_inhabitable_area 0.000
## (0.000)
## date_2020_09:Population_per_1_km_2_of_inhabitable_area -0.000
## (0.000)
## date_2020_02:Secondary_industry_ratio -1.944
## (3.427)
## date_2020_03:Secondary_industry_ratio 2.088
## (3.665)
## date_2020_04:Secondary_industry_ratio 0.939
## (3.073)
## date_2020_05:Secondary_industry_ratio 0.304
## (2.915)
## date_2020_06:Secondary_industry_ratio 2.302
## (2.568)
## date_2020_07:Secondary_industry_ratio -7.037 **
## (2.520)
## date_2020_08:Secondary_industry_ratio 1.324
## (3.192)
## date_2020_09:Secondary_industry_ratio 1.043
## (2.463)
## date_2020_02:Tertiary_industry_ratio -2.005
## (2.806)
## date_2020_03:Tertiary_industry_ratio 3.278
## (3.755)
## date_2020_04:Tertiary_industry_ratio 1.748
## (3.464)
## date_2020_05:Tertiary_industry_ratio -1.684
## (2.810)
## date_2020_06:Tertiary_industry_ratio 4.246
## (2.907)
## date_2020_07:Tertiary_industry_ratio -6.426 *
## (2.957)
## date_2020_08:Tertiary_industry_ratio 3.768
## (3.815)
## date_2020_09:Tertiary_industry_ratio 1.576
## (2.478)
## date_2020_02:Total_population 0.000
## (0.001)
## date_2020_03:Total_population -0.000
## (0.001)
## date_2020_04:Total_population -0.000
## (0.000)
## date_2020_05:Total_population 0.001 *
## (0.000)
## date_2020_06:Total_population 0.000
## (0.000)
## date_2020_07:Total_population 0.000
## (0.000)
## date_2020_08:Total_population 0.000
## (0.001)
## date_2020_09:Total_population 0.001
## (0.000)
## date_2020_02:Ratio_of_aged_population -0.015
## (0.021)
## date_2020_03:Ratio_of_aged_population 0.002
## (0.025)
## date_2020_04:Ratio_of_aged_population 0.001
## (0.018)
## date_2020_05:Ratio_of_aged_population 0.016
## (0.023)
## date_2020_06:Ratio_of_aged_population -0.014
## (0.016)
## date_2020_07:Ratio_of_aged_population 0.007
## (0.019)
## date_2020_08:Ratio_of_aged_population -0.034
## (0.029)
## date_2020_09:Ratio_of_aged_population -0.009
## (0.023)
## as.factor(id)1:year_month_id -0.011
## (0.006)
## as.factor(id)2:year_month_id -0.012 ***
## (0.003)
## as.factor(id)3:year_month_id -0.035 ***
## (0.007)
## as.factor(id)4:year_month_id -0.014 **
## (0.005)
## as.factor(id)5:year_month_id -0.013 **
## (0.005)
## as.factor(id)6:year_month_id -0.017 ***
## (0.005)
## as.factor(id)7:year_month_id -0.027 ***
## (0.007)
## as.factor(id)8:year_month_id -0.007
## (0.005)
## as.factor(id)9:year_month_id -0.007
## (0.005)
## as.factor(id)10:year_month_id -0.001
## (0.006)
## as.factor(id)11:year_month_id -0.016 **
## (0.005)
## as.factor(id)12:year_month_id -0.006
## (0.007)
## as.factor(id)13:year_month_id -0.019 ***
## (0.005)
## as.factor(id)14:year_month_id -0.004
## (0.006)
## as.factor(id)15:year_month_id -0.015 **
## (0.005)
## as.factor(id)16:year_month_id 0.019 **
## (0.007)
## as.factor(id)17:year_month_id 0.011
## (0.006)
## as.factor(id)18:year_month_id -0.003
## (0.006)
## as.factor(id)19:year_month_id -0.021 **
## (0.007)
## as.factor(id)20:year_month_id -0.014
## (0.008)
## as.factor(id)21:year_month_id 0.007
## (0.007)
## as.factor(id)22:year_month_id -0.002
## (0.007)
## as.factor(id)23:year_month_id 0.003
## (0.006)
## as.factor(id)24:year_month_id 0.001
## (0.006)
## as.factor(id)25:year_month_id -0.009
## (0.007)
## as.factor(id)26:year_month_id 0.009
## (0.006)
## as.factor(id)27:year_month_id -0.009
## (0.005)
## as.factor(id)28:year_month_id -0.009
## (0.006)
## as.factor(id)29:year_month_id -0.022 ***
## (0.004)
## as.factor(id)30:year_month_id -0.005
## (0.004)
## as.factor(id)31:year_month_id
##
## as.factor(id)32:year_month_id 0.009 *
## (0.004)
## as.factor(id)33:year_month_id -0.019 ***
## (0.005)
## as.factor(id)34:year_month_id -0.007
## (0.005)
## as.factor(id)35:year_month_id -0.005
## (0.006)
## as.factor(id)36:year_month_id 0.003
## (0.004)
## as.factor(id)37:year_month_id -0.011 *
## (0.005)
## as.factor(id)38:year_month_id -0.004
## (0.003)
## as.factor(id)39:year_month_id -0.023 ***
## (0.006)
## as.factor(id)40:year_month_id -0.008
## (0.005)
## as.factor(id)41:year_month_id -0.057 ***
## (0.007)
## as.factor(id)42:year_month_id -0.025 ***
## (0.006)
## as.factor(id)43:year_month_id -0.005 *
## (0.002)
## as.factor(id)44:year_month_id -0.011 ***
## (0.003)
## as.factor(id)45:year_month_id -0.007
## (0.004)
## as.factor(id)46:year_month_id -0.013 **
## (0.004)
## as.factor(id)47:year_month_id -0.008
## (0.008)
## --------------------------------------------------------------------
## R^2 0.222
## Adj. R^2 0.094
## Num. obs. 1551
## RMSE 17.030
## N Clusters 47
## ====================================================================
## *** p < 0.001; ** p < 0.01; * p < 0.05
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_total_WLS_trend")
# Event study graph
graph_yoy_total_WLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_total_WLS_trend")
ggplotly(graph_yoy_total_WLS_trend_covar)estimates_yoy_total_WLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_OLS_notrend")
# Event study graph
graph_female_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "female_OLS_notrend")
graph_female_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_notrend")
# Event study graph
graph_female_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "female_WLS_notrend")
graph_female_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_OLS_trend")
# Event study graph
graph_female_OLS_trend <- event_study_graph(data = df_estimates,
graph_title = "female_OLS_trend")
graph_female_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_trend")
# Event study graph
graph_female_WLS_trend <- event_study_graph(data = df_estimates ,
graph_title = "female_WLS_trend")
ggplotly(graph_female_WLS_trend)estimates_female_WLS_trend <- df_estimates #for robustness check
results_female_WLS_trend <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_trend")
# Event study graph
graph_female_WLS_trend_onlypost <- event_study_graph(data = df_estimates ,
graph_title = "female_WLS_trend")
ggplotly(graph_female_WLS_trend_onlypost)estimates_female_WLS_trend_onlypost <- df_estimates #for robustness check
results_female_WLS_trend_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_OLS_notrend")
# Event study graph
graph_female_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "female_OLS_notrend")
graph_female_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_notrend")
# Event study graph
graph_female_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "female_WLS_notrend")
graph_female_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_OLS_trend")
# Event study graph
graph_female_OLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "female_OLS_trend")
graph_female_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_female_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_trend")
# Event study graph
graph_female_WLS_trend_covar <- event_study_graph(data = df_estimates ,
graph_title = "female_WLS_trend")
ggplotly(graph_female_WLS_trend_covar)estimates_female_WLS_trend_covar <- df_estimates #for robustness check
results_female_WLS_trend_covar <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "female_WLS_trend")
# Event study graph
graph_female_WLS_trend_covar_onlypost <- event_study_graph(data = df_estimates ,
graph_title = "female_WLS_trend")
ggplotly(graph_female_WLS_trend_covar_onlypost)estimates_female_WLS_trend_covar_onlypost <- df_estimates #for robustness check
results_female_WLS_trend_covar_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_OLS_notrend")
# Event study graph
graph_yoy_female_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_OLS_notrend")
graph_yoy_female_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_WLS_notrend")
# Event study graph
graph_yoy_female_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_WLS_notrend")
graph_yoy_female_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_OLS_trend")
# Event study graph
graph_yoy_female_OLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_OLS_trend")
graph_yoy_female_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_WLS_trend")
# Event study graph
graph_yoy_female_WLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_WLS_trend")
ggplotly(graph_yoy_female_WLS_trend)estimates_yoy_female_WLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_OLS_notrend")
# Event study graph
graph_yoy_female_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_OLS_notrend")
graph_yoy_female_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_WLS_notrend")
# Event study graph
graph_yoy_female_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_WLS_notrend")
graph_yoy_female_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_OLS_trend")
# Event study graph
graph_yoy_female_OLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_OLS_trend")
graph_yoy_female_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_female_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_female,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_female_WLS_trend")
# Event study graph
graph_yoy_female_WLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_female_WLS_trend")
ggplotly(graph_yoy_female_WLS_trend_covar)estimates_yoy_female_WLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_OLS_notrend")
# Event study graph
graph_male_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "male_OLS_notrend")
graph_male_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_notrend")
# Event study graph
graph_male_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "male_WLS_notrend")
graph_male_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_OLS_trend")
# Event study graph
graph_male_OLS_trend <- event_study_graph(data = df_estimates ,
graph_title = "male_OLS_trend")
graph_male_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_trend")
# Event study graph
graph_male_WLS_trend <- event_study_graph(data = df_estimates ,
graph_title = "male_WLS_trend")
ggplotly(graph_male_WLS_trend)estimates_male_WLS_trend <- df_estimates #for robustness check
results_male_WLS_trend <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_trend")
# Event study graph
graph_male_WLS_trend_onlypost <- event_study_graph(data = df_estimates ,
graph_title = "male_WLS_trend")
ggplotly(graph_male_WLS_trend_onlypost)estimates_male_WLS_trend_onlypost <- df_estimates #for robustness check
results_male_WLS_trend_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_OLS_notrend")
# Event study graph
graph_male_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "male_OLS_notrend")
graph_male_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_notrend")
# Event study graph
graph_male_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "male_WLS_notrend")
graph_male_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_OLS_trend")
# Event study graph
graph_male_OLS_trend_covar <- event_study_graph(data = df_estimates ,
graph_title = "male_OLS_trend")
graph_male_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_male_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_trend")
# Event study graph
graph_male_WLS_trend_covar <- event_study_graph(data = df_estimates ,
graph_title = "male_WLS_trend")
ggplotly(graph_male_WLS_trend_covar)estimates_male_WLS_trend_covar <- df_estimates #for robustness check
results_male_WLS_trend_covar <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_onlypost_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "male_WLS_trend")
# Event study graph
graph_male_WLS_trend_covar_onlypost <- event_study_graph(data = df_estimates ,
graph_title = "male_WLS_trend")
ggplotly(graph_male_WLS_trend_covar_onlypost)estimates_male_WLS_trend_covar_onlypost <- df_estimates #for robustness check
results_male_WLS_trend_covar_onlypost <- estimation_results # for only-post DID table# DID estimation
estimation_results <- dynamic_DID_OLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_OLS_notrend")
# Event study graph
graph_yoy_male_OLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_OLS_notrend")
graph_yoy_male_OLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_OLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_WLS_notrend")
# Event study graph
graph_yoy_male_WLS_notrend <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_WLS_notrend")
graph_yoy_male_WLS_notrend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_WLS_notrend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_OLS_trend")
# Event study graph
graph_yoy_male_OLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_OLS_trend")
graph_yoy_male_OLS_trend## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_OLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_WLS_trend")
# Event study graph
graph_yoy_male_WLS_trend <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_WLS_trend")
ggplotly(graph_yoy_male_WLS_trend)estimates_yoy_male_WLS_trend <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_OLS_notrend")
# Event study graph
graph_yoy_male_OLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_OLS_notrend")
graph_yoy_male_OLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_OLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_notrend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_WLS_notrend")
# Event study graph
graph_yoy_male_WLS_notrend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_WLS_notrend")
graph_yoy_male_WLS_notrend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_WLS_notrend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_OLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_OLS_trend")
# Event study graph
graph_yoy_male_OLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_OLS_trend")
graph_yoy_male_OLS_trend_covar## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
estimates_yoy_male_OLS_trend_covar <- df_estimates #for robustness check# DID estimation
estimation_results <- dynamic_DID_WLS_trend_covar8Xcovid_months(dataset = df_analysis,
outcome_var = df_analysis$yoy_suicide_rate_male,
treat_var = df_analysis$job_seeker_total_shock)
#texreg::screenreg(l = estimation_results , include.ci = FALSE, digits=3,)
# DID estimates and 90% CI
df_estimates <- DID_coefficients_main(DID_results = estimation_results,
treat_var = "job_seeker_total_shock",
estimation_label = "yoy_male_WLS_trend")
# Event study graph
graph_yoy_male_WLS_trend_covar <- event_study_graph(data = df_estimates,
graph_title = "yoy_male_WLS_trend")
ggplotly(graph_yoy_male_WLS_trend_covar)estimates_yoy_male_WLS_trend_covar <- df_estimates #for robustness checkggplotly(graph_total_WLS_trend)ggplotly(graph_total_WLS_trend_covar)ggplotly(graph_female_WLS_trend)ggplotly(graph_female_WLS_trend_covar)ggplotly(graph_male_WLS_trend)ggplotly(graph_male_WLS_trend_covar)#merge and label estimates data
estimates_total_bind <- dplyr::bind_rows(estimates_total_OLS_notrend,
estimates_total_WLS_notrend,
estimates_total_OLS_trend,
estimates_total_WLS_trend)
#change labels and reorder labels
estimates_total_bind <- estimates_labeling_main(estimates_total_bind)
# Display results
DT::datatable(estimates_total_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_total_bind <- event_study_graph_bind_main(data = estimates_total_bind,
graph_title = "(a) Total suicide rate")
ggplotly(graph_total_bind)#ggplotly(graph_total_bind)#merge and label estimates data
estimates_total_bind <- dplyr::bind_rows(estimates_total_OLS_notrend_covar,
estimates_total_WLS_notrend_covar,
estimates_total_OLS_trend_covar,
estimates_total_WLS_trend_covar)
#change labels and reorder labels
estimates_total_bind <- estimates_labeling_main(estimates_total_bind)
# Display results
DT::datatable(estimates_total_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_total_bind_covar <- event_study_graph_bind_main(data = estimates_total_bind,
graph_title = "(a) Total suicide rate")
ggplotly(graph_total_bind_covar)#merge and label estimates data
estimates_yoy_total_bind <- dplyr::bind_rows(estimates_yoy_total_OLS_notrend,
estimates_yoy_total_WLS_notrend,
estimates_yoy_total_OLS_trend,
estimates_yoy_total_WLS_trend)
#change labels and reorder labels
estimates_yoy_total_bind <- estimates_labeling_main(estimates_yoy_total_bind)
# display results
DT::datatable(estimates_yoy_total_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_total_bind <- event_study_graph_bind_main(data = estimates_yoy_total_bind,
graph_title = "(b) Total suicide rate (year-on-year)")
ggplotly(graph_yoy_total_bind)#merge and label estimates data
estimates_yoy_total_bind <- dplyr::bind_rows(estimates_yoy_total_OLS_notrend_covar,
estimates_yoy_total_WLS_notrend_covar,
estimates_yoy_total_OLS_trend_covar,
estimates_yoy_total_WLS_trend_covar)
#change labels and reorder labels
estimates_yoy_total_bind <- estimates_labeling_main(estimates_yoy_total_bind)
# display results
DT::datatable(estimates_yoy_total_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_total_bind_covar <- event_study_graph_bind_main(data = estimates_yoy_total_bind,
graph_title = "(b) Total suicide rate (year-on-year)")
ggplotly(graph_yoy_total_bind_covar)#merge and label estimates data
estimates_female_bind <- dplyr::bind_rows(estimates_female_OLS_notrend,
estimates_female_WLS_notrend,
estimates_female_OLS_trend,
estimates_female_WLS_trend)
#change labels and reorder labels
estimates_female_bind <- estimates_labeling_main(estimates_female_bind)
# display results
DT::datatable(estimates_female_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_female_bind <- event_study_graph_bind_main(data = estimates_female_bind,
graph_title = "(c) Female suicide rate")
ggplotly(graph_female_bind)#merge and label estimates data
estimates_female_bind <- dplyr::bind_rows(estimates_female_OLS_notrend_covar,
estimates_female_WLS_notrend_covar,
estimates_female_OLS_trend_covar,
estimates_female_WLS_trend_covar)
#change labels and reorder labels
estimates_female_bind <- estimates_labeling_main(estimates_female_bind)
# display results
DT::datatable(estimates_female_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_female_bind_covar <- event_study_graph_bind_main(data = estimates_female_bind,
graph_title = "(c) Female suicide rate")
ggplotly(graph_female_bind_covar)#merge and label estimates data
estimates_yoy_female_bind <- dplyr::bind_rows(estimates_yoy_female_OLS_notrend,
estimates_yoy_female_WLS_notrend,
estimates_yoy_female_OLS_trend,
estimates_yoy_female_WLS_trend)
#change labels and reorder labels
estimates_yoy_female_bind <- estimates_labeling_main(estimates_yoy_female_bind)
# display results
DT::datatable(estimates_yoy_female_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_female_bind <- event_study_graph_bind_main(data = estimates_yoy_female_bind,
graph_title = "(d) Female suicide rate (year-on-year)")
ggplotly(graph_yoy_female_bind)#merge and label estimates data
estimates_yoy_female_bind <- dplyr::bind_rows(estimates_yoy_female_OLS_notrend_covar,
estimates_yoy_female_WLS_notrend_covar,
estimates_yoy_female_OLS_trend_covar,
estimates_yoy_female_WLS_trend_covar)
#change labels and reorder labels
estimates_yoy_female_bind <- estimates_labeling_main(estimates_yoy_female_bind)
# display results
DT::datatable(estimates_yoy_female_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_female_bind_covar <- event_study_graph_bind_main(data = estimates_yoy_female_bind,
graph_title = "(d) Female suicide rate (year-on-year)")
ggplotly(graph_yoy_female_bind_covar)#merge and label estimates data
estimates_male_bind <- dplyr::bind_rows(estimates_male_OLS_notrend,
estimates_male_WLS_notrend,
estimates_male_OLS_trend,
estimates_male_WLS_trend)
#change labels and reorder labels
estimates_male_bind <- estimates_labeling_main(estimates_male_bind)
# display results
DT::datatable(estimates_male_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_male_bind <- event_study_graph_bind_main(data = estimates_male_bind,
graph_title = "(e) Male Suicide rate")
ggplotly(graph_male_bind)#merge and label estimates data
estimates_male_bind <- dplyr::bind_rows(estimates_male_OLS_notrend_covar,
estimates_male_WLS_notrend_covar,
estimates_male_OLS_trend_covar,
estimates_male_WLS_trend_covar)
#change labels and reorder labels
estimates_male_bind <- estimates_labeling_main(estimates_male_bind)
# display results
DT::datatable(estimates_male_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_male_bind_covar <- event_study_graph_bind_main(data = estimates_male_bind,
graph_title = "(e) Male Suicide rate")
ggplotly(graph_male_bind_covar)#merge and label estimates data
estimates_yoy_male_bind <- dplyr::bind_rows(estimates_yoy_male_OLS_notrend,
estimates_yoy_male_WLS_notrend,
estimates_yoy_male_OLS_trend,
estimates_yoy_male_WLS_trend)
#change labels and reorder labels
estimates_yoy_male_bind <- estimates_labeling_main(estimates_yoy_male_bind)
# display results
DT::datatable(estimates_yoy_male_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_male_bind <- event_study_graph_bind_main(data = estimates_yoy_male_bind,
graph_title = "(f) Male Suicide rate (year-on-year)")
ggplotly(graph_yoy_male_bind)#merge and label estimates data
estimates_yoy_male_bind <- dplyr::bind_rows(estimates_yoy_male_OLS_notrend_covar,
estimates_yoy_male_WLS_notrend_covar,
estimates_yoy_male_OLS_trend_covar,
estimates_yoy_male_WLS_trend_covar)
#change labels and reorder labels
estimates_yoy_male_bind <- estimates_labeling_main(estimates_yoy_male_bind)
# display results
DT::datatable(estimates_yoy_male_bind) %>%
DT::formatRound(columns = c("estimate", "ci_lower", "ci_upper"), digits=3)#graph
graph_yoy_male_bind_covar <- event_study_graph_bind_main(data = estimates_yoy_male_bind,
graph_title = "(f) Male Suicide rate (year-on-year)")
ggplotly(graph_yoy_male_bind_covar)#Legendの表示
graph_for_legend <- graph_total_bind +
theme(legend.position = 'bottom', # Adjust x axis label
legend.title = element_text(colour = "black", size = 20),
legend.text = element_text(color = "black", size = 20))
graph_for_legend #extract legend
legend_model_types <- ggpubr::get_legend(graph_for_legend)
legend_model_types <- ggpubr::as_ggplot(legend_model_types)
legend_model_types#2行Legendの表示
graph_for_legend_2row <- graph_total_bind +
theme(legend.position = 'bottom', # Adjust x axis label
legend.title = element_text(colour = "black", size = 20),
legend.text = element_text(color = "black", size = 20))+
guides(color = guide_legend(nrow = 2, byrow = TRUE)) #legendを二行に変更 2021Sep7 Waki
graph_for_legend_2row #extract legend
legend_2row_model_types <- ggpubr::get_legend(graph_for_legend_2row)
legend_2row_model_types <- ggpubr::as_ggplot(legend_2row_model_types)
legend_2row_model_typesグラフを統合して論文用に保存。
dpi_num <- 100
width_num <- 15
height_num <- 20
ymin <- - 7
ymax <- 5
ymin_num <- - 5
ymax_num <- 5
interval <- 2.5graph_total_WLS_trend <- graph_total_WLS_trend +
labs(title = "(a) Total") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_total_WLS_trend_covar <- graph_total_WLS_trend_covar +
labs(title = "(b) Total, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_female_WLS_trend <- graph_female_WLS_trend +
labs(title = "(c) Female")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_female_WLS_trend_covar <- graph_female_WLS_trend_covar +
labs(title = "(d) Female, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_male_WLS_trend <- graph_male_WLS_trend +
labs(title = "(e) Male")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_male_WLS_trend_covar <- graph_male_WLS_trend_covar +
labs(title = "(f) Male, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph <- (graph_total_WLS_trend | graph_total_WLS_trend_covar) /
(graph_female_WLS_trend | graph_female_WLS_trend_covar) /
(graph_male_WLS_trend | graph_male_WLS_trend_covar) /
legend_model_types +
plot_layout(heights = c(2, 2, 2, 0.5))
graph## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
#保存
ggsave(file = "output/graph_job_seeker_total_shock_on_suicide_WLStrends.pdf", plot = graph,
dpi = dpi_num, width = width_num, height = height_num) ## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
graph_yoy_total_WLS_trend <- graph_yoy_total_WLS_trend +
labs(title = "(a) Total") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_total_WLS_trend_covar <- graph_yoy_total_WLS_trend_covar +
labs(title = "(b) Total, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_female_WLS_trend <- graph_yoy_female_WLS_trend +
labs(title = "(c) Female")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_female_WLS_trend_covar <- graph_yoy_female_WLS_trend_covar +
labs(title = "(d) Female, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_male_WLS_trend <- graph_yoy_male_WLS_trend +
labs(title = "(e) Male ")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_male_WLS_trend_covar <- graph_yoy_male_WLS_trend_covar +
labs(title = "(f) Male, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph <- (graph_yoy_total_WLS_trend | graph_yoy_total_WLS_trend_covar) /
(graph_yoy_female_WLS_trend | graph_yoy_female_WLS_trend_covar) /
(graph_yoy_male_WLS_trend | graph_yoy_male_WLS_trend_covar) /
legend_model_types +
plot_layout(heights = c(2, 2, 2, 0.5))
graph## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
#保存
ggsave(file = "output/graph_job_seeker_total_shock_diff2_on_yoy_suicide_WLStrends.pdf", plot = graph,
dpi = dpi_num, width = width_num, height = height_num) ## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
## Warning: Removed 32 rows containing missing values (geom_point).
## Warning: Removed 32 row(s) containing missing values (geom_path).
graph_total_bind <- graph_total_bind +
labs(title = "(a) Total") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_total_bind_covar <- graph_total_bind_covar +
labs(title = "(b) Total, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_female_bind <- graph_female_bind +
labs(title = "(c) Female")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_female_bind_covar <- graph_female_bind_covar +
labs(title = "(d) Female, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_male_bind <- graph_male_bind +
labs(title = "(e) Male")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_male_bind_covar <- graph_male_bind_covar +
labs(title = "(f) Male, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph <- (graph_total_bind | graph_total_bind_covar) /
(graph_female_bind| graph_female_bind_covar) /
(graph_male_bind| graph_male_bind_covar) /
legend_model_types +
plot_layout(heights = c(2, 2, 2, 0.5))
graph#保存
ggsave(file = "output/graph_job_seeker_total_shock_on_suicide_robust.pdf", plot = graph,
dpi = dpi_num, width = width_num, height = height_num) graph_yoy_total_bind <- graph_yoy_total_bind +
labs(title = "(a) Total") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_total_bind_covar <- graph_yoy_total_bind_covar +
labs(title = "(b) Total, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_female_bind <- graph_yoy_female_bind +
labs(title = "(c) Female")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_female_bind_covar <- graph_yoy_female_bind_covar +
labs(title = "(d) Female, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_male_bind <- graph_yoy_male_bind +
labs(title = "(e) Male")+
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph_yoy_male_bind_covar <- graph_yoy_male_bind_covar +
labs(title = "(f) Male, with covaraites") +
scale_y_continuous(limit = c(ymin, ymax), breaks=seq(ymin_num, ymax_num, interval))
graph <- (graph_yoy_total_bind | graph_yoy_total_bind_covar) /
(graph_yoy_female_bind| graph_yoy_female_bind_covar) /
(graph_yoy_male_bind| graph_yoy_male_bind_covar) /
legend_model_types +
plot_layout(heights = c(2, 2, 2, 0.5))
graph#保存
ggsave(file = "output/graph_job_seeker_total_shock_on_yoy_suicide_robust.pdf", plot = graph,
dpi = dpi_num, width = width_num, height = height_num) options("modelsummary_format_numeric_latex" = "plain")
# 列の選択 column order
# 男女合計、女性、男性、YOYのみ, monthlyhのみ
rows_MONTH <- tribble(~name, ~"(1)", ~"(2)", ~"(3)", ~"(4)", ~"(5)", ~"(6)",
"Ref. month", "\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}", "\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}","\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}")
## results list
table_results_MONTH <- list()
table_results_MONTH[["(1)"]] <- results_total_WLS_trend
table_results_MONTH[["(2)"]] <- results_total_WLS_trend_onlypost
table_results_MONTH[["(3)"]] <- results_female_WLS_trend
table_results_MONTH[["(4)"]] <- results_female_WLS_trend_onlypost
table_results_MONTH[["(5)"]] <- results_male_WLS_trend
table_results_MONTH[["(6)"]] <- results_male_WLS_trend_onlypost
## HTML table
estimates_table_MONTH(df = table_results_MONTH,
rows = rows_MONTH,
title_words = "Suicide",
gof = gm,
output_style = "html") %>%
kableExtra::add_header_above(c(" " = 1, "Total" = 2, "Female" = 2, "Male" = 2))
## Latex table
estimates_table_MONTH(df = table_results_MONTH,
rows = rows_MONTH,
gof = gm,
title_words = "DID estimates for suicide rates\\label{tab:DID_unemploy_on_suicide}",
output_style = "latex") %>%
kableExtra::add_header_above(c(" " = 1, "Total" = 2, "Female" = 2, "Male" = 2)) %>%
kableExtra::add_footnote(c("Notes: Robust standard errors are clustered at the prefecture level and the number of clusters (i.e. prefectures) is 47. The treatment variable is the COVID-19-induced employment shock, which is calculated as equation \\eqref{eq:employment_shock}. Estimates are obtained based on equation \\eqref{eq:did_model_ver2} with WLS estimation weighted by prefecture population size."),threeparttable = TRUE, notation = "none",escape = FALSE) %>%
kableExtra::column_spec(2:7, width = "1.5cm") %>%
kableExtra::save_kable("output/job_seeker_total_shock_on_suicide_robust_tables.tex")# 列の選択 column order
# 男女合計、女性、男性、YOYのみ, monthlyhのみ
rows_MONTH <- tribble(~name, ~"(1)", ~"(2)", ~"(3)", ~"(4)", ~"(5)", ~"(6)",
"Ref. month", "\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}", "\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}","\\footnotesize{Jan.2020}", "\\footnotesize{$\\leq$Jan.2020}")
## results list
table_results_MONTH <- list()
table_results_MONTH[["(1)"]] <- results_total_WLS_trend_covar
table_results_MONTH[["(2)"]] <- results_total_WLS_trend_covar_onlypost
table_results_MONTH[["(3)"]] <- results_female_WLS_trend_covar
table_results_MONTH[["(4)"]] <- results_female_WLS_trend_covar_onlypost
table_results_MONTH[["(5)"]] <- results_male_WLS_trend_covar
table_results_MONTH[["(6)"]] <- results_male_WLS_trend_covar_onlypost
## HTML table
estimates_table_MONTH(df = table_results_MONTH,
rows = rows_MONTH,
title_words = "Suicide",
gof = gm,
output_style = "html") %>%
kableExtra::add_header_above(c(" " = 1, "Total" = 2, "Female" = 2, "Male" = 2))
## Latex table
estimates_table_MONTH(df = table_results_MONTH,
rows = rows_MONTH,
gof = gm,
title_words = "DID estimates for suicide rates, with covariates\\label{tab:DID_unemploy_on_suicide_covar}",
output_style = "latex") %>%
kableExtra::add_header_above(c(" " = 1, "Total" = 2, "Female" = 2, "Male" = 2)) %>%
kableExtra::add_footnote(c("Notes: Robust standard errors are clustered at the prefecture level and the number of clusters (i.e. prefectures) is 47. The treatment variable is the COVID-19-induced employment shock, which is calculated as equation \\eqref{eq:employment_shock}. Estimates are obtained based on equation \\eqref{eq:did_model_ver2} with WLS estimation weighted by prefecture population size."),threeparttable = TRUE, notation = "none",escape = FALSE) %>%
kableExtra::column_spec(2:7, width = "1.5cm") %>%
kableExtra::save_kable("output/job_seeker_total_shock_on_suicide_robust_covar_tables.tex")